package util;

import play.core.j.JavaAction;
import play.mvc.Action;
import play.mvc.Http.Context;
import play.mvc.Result;

public class DefaultExceptionHandler extends Action.Simple {
	public final static String USER_ID = "userID";

	@Override
	public Result call( Context ctx ) throws Throwable {

		try {
			return delegate.call( ctx );
		}
		catch ( Exception e ) {

			System.out.println( "Here I do de server stuff por exception handling like knowing what's this shit calling and logging..."
					+ e.getMessage() );
			System.out.println( ( ( JavaAction ) delegate.delegate ) );
			return internalServerError( e.getMessage() );
		}

	}
}
